import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/system',
  component: Layout,
  redirect: '/system/user',
  name: 'System',
  meta: {
    title: '系统设置',
    icon: 'ep:tools',
    auth: ['system'],
  },
  children: [
    {
      path: 'user',
      name: 'SystemUser',
      component: () => import('@/views/system/user.vue'),
      meta: {
        title: '用户管理',
        activeMenu: '/system/user',
        auth: ['system.member'],
      },
    },
    {
      path: 'menu',
      name: 'SystemMenu',
      component: () => import('@/views/system/menu.vue'),
      meta: {
        title: '接口管理',
        activeMenu: '/system/menu',
        auth: ['system.menu'],
      },
    },
    {
      path: 'auth',
      name: 'SystemAuth',
      component: () => import('@/views/system/auth.vue'),
      meta: {
        title: '权限管理',
        activeMenu: '/system/auth',
        auth: ['system.auth'],
      },
    },
    {
      path: 'test',
      name: 'SystemTuth',
      component: () => import('@/views/system/test.vue'),
      meta: {
        title: '测试权限',
        activeMenu: '/system/test',
        auth: ['system.test'],
      },
    },
  ],
}

export default routes
